/**
 * 
 */
package org.chungyan5.mnt.lib;

import java.io.Serializable;
import java.util.Comparator;

/**
 * @author yan
 *
 */
public class MNTTagComparator implements Comparator<MNTTag>, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3375903787248850068L;

	@Override
	public int compare(MNTTag arg0, MNTTag arg1) {
		
		if (arg0.getId().compareTo(arg1.getId()) ==0) {	// if id is same, return same of this two tags
        	return 0;
       } else {												// otherwise, chk the name in alphabetical order
           return arg0.getName().compareTo(arg1.getName());
        }
	}

}
